<?php
 defined('RUN')or die('No access');class Captcha{public static function getCaptcha($a=6,$b=TRUE){$c=($a==6)?'':'?length='.$a;$d=($a==6)?"''":"'&length=$a'";$e='<img id="svdm_captcha" src="'.URL::base().'/scripts/captcha/new.php'.$c.'" alt="Timeout !" />';if($b)$e.='&nbsp;<img src="'.URL::base().'/scripts/captcha/new_captcha.png" onclick="document.getElementById(\'svdm_captcha\').src = \''.URL::base().'/scripts/captcha/new.php?\' + Math.random() + '.$d.'; return false" alt="Get new captcha" title="Get new captcha" style="cursor: pointer;" />';return $e;}public static function checkCaptcha($f){if(!isset($_SESSION['svdm_captcha_hash']))return FALSE;$g=$_SESSION['svdm_captcha_hash'];unset($_SESSION['svdm_captcha_hash']);if($g==md5($f)){return TRUE;}return FALSE;}}